package com.ruoyi.web.controller.shopping.backend;

import com.ruoyi.system.domain.shopping.Picture;
import com.ruoyi.system.service.shopping.PictureService;
import com.ruoyi.system.view.common.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/backend/shopping/picture")
public class PictureController {
    @Autowired
    private PictureService pictureService;
    @PostMapping
    public Result add(@RequestBody Picture picture){
        Boolean aBoolean = pictureService.add(picture);
        if(aBoolean){
            return Result.success(null,"更新成功");
        }
        return Result.error(null,201,"更新失败");
    }
}
